package com.yang.frost.blueberry.service.impl;

import com.yang.frost.blueberry.mapper.UmsUserMapper;
import com.yang.frost.blueberry.params.BaseParam;
import com.yang.frost.blueberry.params.UmsUserParam;
import com.yang.frost.blueberry.service.UmsUserService;
import com.yang.frost.blueberry.util.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 10296
 * @date 2021/5/24
 * @Description:
 */
@Service
public class UmsUserServiceImpl implements UmsUserService {

    @Autowired
    private UmsUserMapper userMapper;

    @Override
    public ApiResult insertSysUser(UmsUserParam userParam) {
        int i = userMapper.saveSysUser(userParam);

        return ApiResult.ok(i, "添加成功");

    }

    @Override
    public ApiResult deleteSysUser(BaseParam baseParam) {
        int i = userMapper.deleteSysUserById(baseParam.getId());
        return ApiResult.ok(i, "删除成功");

    }

    @Override
    public ApiResult updateSysUser(UmsUserParam userParam) {
        int i = userMapper.updateSysUser(userParam);
        return ApiResult.ok(i, "修改成功");
    }

    @Override
    public ApiResult qrySysUserList(BaseParam baseParam) {
        return null;
    }
}
